* This is the do file to create "Figure B1. Propensity Score Overlap"

use "$path_data/temp/followup_student_parents_matched", replace

// variable
gen gend = q1d - 1


local controls DT_score_pre_std_missing_0 rosen_pre_std_missing_0 cpcs_pre_std_missing_0 i.grade gend branch1 branch2 branch3 income_source1 income_source2 income_source3 income_source4 last_income_per_member hhmember hhheadage hhheadeduyear phone_survey age_tchr


// PS 
logit treatment `controls'
predict ps
label define treatlabel 1 "treatment" 0 "control"
label val treatment treatlabel
* hist ps, by(treatment) bin(30)
* graph save "`pardir'/fig_ps.png", replace

ksmirnov ps, by(treatment)

twoway (kdensity ps if treatment == 0, bwidth(0.01) lcolor(blue)) (kdensity ps if treatment == 1, bwidth(0.01) lcolor(red)), ///
       legend(label(1 "Control") label(2 "Treatment")) ///
	   ytitle("density") xtitle("propensity score")
graph save "$path_output/fig_ps.png", replace
